package com.juicygames.framework.draw;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

import com.juicygames.framework.GameAction;
import com.juicygames.framework.action.DrawAction;
import com.juicygames.framework.gamepart.GameHandler;
import com.juicygames.framework.gamepart.GamePart;

public class TextDisplay extends GameHandler {
	
	private float x;
	private float y;
	private String text;
	private Paint paint;
	
	public TextDisplay(GamePart self) {
		super(self);
		setActionClassHandled(DrawAction.class);
		
		x = 0;
		y = 0;
		text = "";

		paint = new Paint();
		paint.setColor(Color.WHITE);
		paint.setAlpha(255); 
	}
	
	public void handle(GameAction action) {
		super.handle(action);
		
		DrawAction draw = (DrawAction) action;
		Canvas canvas = draw.getCanvas();
		
		canvas.drawText(text, x, y, paint);
	}

	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Paint getPaint() {
		return paint;
	}

	public void setPaint(Paint paint) {
		this.paint = paint;
	}
	
	

}
